const state = {
    userName: '',
    realName: ''
}

const mutations = {
    setUserData: (state,user) => {
        if(user){
            let userData = JSON.parse(user)
            state.userName = userData.userName
            state.realName = userData.realName
        }

    },
}
const actions = {

}
const getters = {
    getRealName : (state)=>{
        return state.realName
    }
}

export default {
    namespaced : true,
    state,
    mutations,
    actions,
    getters
}
